class Solution {
public:
    bool halvesAreAlike(string s)
    {
        string tmp = "aeiouAEIOU";
        vector<int> hash(127);
        for (auto e : tmp) hash[e - 'A']++;
        // cout<<"x";

        int depart = s.size() / 2;
        int count1 = 0, count2 = 0;
        int i = 0;
        for (; i < depart; i++)
            if (hash[s[i] - 'A']) count1++;

        for (; i < s.size(); i++)
            if (hash[s[i] - 'A']) count2++;
        if (count1 == count2) return true;
        return false;

    }
};